home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_10_08
/
1008071a
< prev
next >
Wrap
Text File
|
1991-10-13
|
2KB
|
60 lines
/*
Copyright (c) Robert Ramey 1991. All Rights Reserved
*/
#include <stdio.h>
#include <signal.h>
#include "psort.h"
#include "os.h"
/*********************************************************************
os_init - initialize input/output
**********************************************************************/
os_init(argc, argv)
int argc;
char *argv[];
{
if(signal(SIGINT, SIG_DFL) == SIG_ERR)
error("Couldn't establish ^C handler");
}
/*********************************************************************
error - takes control when aborted with ^C
**********************************************************************/
void
error(msg)
char *msg;
{
fputs(msg, stderr);
exit(1);
}
/*********************************************************************
cbreak - takes control when aborted with ^C
**********************************************************************/
/*
void
cbreak()
{
fputs("Aborted by Operator", stderr);
exit(3);
}
*/
/*********************************************************************
os_mavl - figure how much memory can be allocated
**********************************************************************/
/*
MEM_SIZE
os_mavl()
{
return (MEM_SIZE)_bios_memsize() / K;
}
*/
/*********************************************************************
os_flength - returns number of bytes in file
**********************************************************************/
#include <io.h>
FILE_SIZE
os_flength(fptr)
FILE *fptr;
{
return filelength(fileno(fptr));
}